package main

import (
	"fmt"
	"reflect"
)

func main() {
	_type("123")
	_type(123)
	_type(map[string]interface{}{
		"123": "123",
		"234": 234,
	})
}

func _type(v interface{}) {

	switch value := v.(type) {
	case int:
		fmt.Printf("int: %#v\n", value)
	case string:
		fmt.Printf("string: %#v\n", value)
	}

	t := reflect.ValueOf(v)
	_t := t.Type()
	switch _t.Kind() {
	case reflect.Map:
		fmt.Printf("int: %#v\n", t.MapKeys())
	case reflect.String:
		fmt.Printf("int: %#v\n", t.String())
	case reflect.Int:
		fmt.Printf("int: %#v\n", t.Int())
	}

}
